<?php
/**
 * The coltroller to manage the header for the application
 * 
 * @author Youssef Driouach
 *
 * 20 août 2012
 */

class HeaderController extends Zend_Controller_Action
{

	public function init()
	{
		
		 
	}

	/**
	 * The action to manage the menu type.
	 */
	public function indexAction()
	{
		
		$this->view->statusConn = false;
		$helperUrl = new Zend_View_Helper_Url ( );
		$auth = Zend_Auth::getInstance ();
		if ($auth->hasIdentity ()) {
			$username = strtoupper ( substr ( $auth->getIdentity ()->lastName, 0, 1 ) ) . ' ' . $auth->getIdentity ()->firstName . '.';
			$logoutLink = $helperUrl->url ( array ('action' => 'logout', 'controller' => 'login' ) );
			
			$this->view->statusConn = true;
			$this->view->bienvenue = 'Bienvenue';
			$this->view->userName = $username;
			$this->view->logoutLink = $logoutLink;
		}
		 
	}


}
